<%@ page import="com.fuful.domain.Product" %>
<%@ page import="java.util.List" %>
<%@ page import="java.util.ArrayList" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<p>
<form name="cx" action="cxProduct.do" method="post">
    <input type="text" id="productname" name="pname" placeholder="请输入查询产品名称">
    <input type="submit" value="查询">
</form>
</p>
<table border="1">
    <tr>
        <td>产品编码</td>
        <td>产品名称</td>
        <td>产品类型</td>
        <td>产品价格</td>
        <td>操作</td>
    </tr>
    <%
        //获取共享对象
        List<Product> data = (ArrayList)session.getAttribute("productdata");
        for (Product p : data) {
    %>
    <tr>
        <td><%= p.getPcode()%></td>
        <td><%= p.getPname()%></td>
        <td><a href="findPTypeProducts.do?ptid=<%= p.getPtid().getPtid()%>"><%= p.getPtid().getPtname()%></a></td>
        <td><%= p.getPprice()%></td>
        <td><a href="addCart.do?pid=<%= p.getPid()%>">添加</a></td>
    </tr>
    <%
        }
    %>
</table>
</body>
</html>
